package com.tx.zlm_replay.common;

/**
 * @author tx
 * @version 1.0
 * @date 2024/3/18 14:38
 * @description: 系统异常
 */
public class RException extends RuntimeException {
    private RwithD errResult;

    private RException(RwithD errResult) {
        super(errResult.toString());
        this.errResult = errResult;
    }

    public static RException info(String errInfo) {
        return new RException(RwithD.fail(errInfo));
    }

    public static RException info(RwithD errResult) {
        return new RException(errResult);
    }

    public static RException fail() {
        return new RException(RwithD.fail());
    }

    public RwithD getErrResult() {
        return errResult;
    }

    public RException setErrResult(RwithD errResult) {
        this.errResult = errResult;
        return this;
    }
}
